Setup the LaTeX environment in vscode

I want to give up texstudio in my Mac due to its ugly GUI.

OS

  • macOS 10.14.2

Setup Steps

  1. Install MacTex. Do not update package in default setting especially you are SJTUer. If you update, the font will be different.
  2. Install vscode (Free!)
  3. Install LaTex Workshop (an extension of vscode)
  4. Adding the follow code to Settings of vscode:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    "latex-workshop.latex.tools": [
    {
    // 编译工具和命令
    "name": "xelatex",
    "command": "xelatex",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "-pdf",
    "%DOC%"
    ]
    },
    {
    "name": "pdflatex",
    "command": "pdflatex",
    "args": [
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOC%"
    ]
    },
    {
    "name": "bibtex",
    "command": "bibtex",
    "args": [
    "%DOCFILE%"
    ]
    },
    {
    "name": "biber",
    "command": "biber",
    "args": [
    "--debug",
    "%DOCFILE%"
    ]
    }
    ],
    "latex-workshop.latex.recipes": [
    {
    "name": "xe->bib->xe->xe",
    "tools": [
    "xelatex",
    "biber",
    "xelatex",
    "xelatex"
    ]
    },
    {
    "name": "xelatex",
    "tools": [
    "xelatex"
    ]
    }
    ],
分享到